/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import utils.Utils;
import java.util.List;
import java.util.LinkedList;

/**
 *
 * @author wpc
 */
public class Path {

    private int[] steps;
    private int id;
    private static int IDS = 0;

    public Path(int[] steps) {
        this(steps,IDS);
        IDS++;
    }

    public Path(int[] steps, int id) {
        this.steps = steps;
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public int now(int index){
        return this.steps[index];
    }

    @Override
    public String toString(){
        List<String> list = new LinkedList<String>();
        for(int i:steps){
          list.add(Integer.toString(i));
        }
        return Utils.join(list, "->");
    }

}
